home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / amos / amoslist-0195.lzh / AMOSLIST / text0004.txt < prev    next >
Encoding:
Text File  |  1995-02-01  |  1.4 KB  |  37 lines

  1. >Now if someone could shed light on how to use the mysterious Hardcol
  2. >and Set HardCol commands, I'd name my first-born after them. :-)
  3.  
  4.   Hey, I'm perfectly willing to help - you don't need to bribe me. :-)
  5.  
  6.   As I understand it (I've never actually used the instructions),
  7. Set Hardcol's two parameters work like this: the first controls which
  8. odd-numbered sprites are considered in the collision detection, and the
  9. second is simply a pen number in the background to check.  Normally,
  10. hardware collision detection will only look at even-numbered sprites,
  11. but by setting bits in the first parameter, you can let odd-numbered
  12. sprites be considered also:
  13.  
  14.     Bit #    Sprite #
  15.     -----    --------
  16.       0       1
  17.       1       3
  18.       2       5
  19.       3       7
  20.  
  21.   The only problem with this is that there's no way to tell whether an
  22. even-numbered sprite or its odd-numbered partner were involved in a
  23. collision, so odd-numbered sprite collisions are of limited use.
  24.  
  25.   The =Hardcol function returns whether a collision has been detected.
  26. You can then use the =Col function to determine which sprite was
  27. involved in the collision.  If the collision occurred between a sprite
  28. and the background, everything's fine; but if the collision was between
  29. two sprites, you may or may not find out both of the sprite numbers - I
  30. don't know, having never tried.
  31.  
  32.   Is that explanation enough?  Or have I been completely
  33. incomprehensible? :-)
  34.  
  35.   --Andy Church
  36.  
  37.